using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using QuanLyThietBi.Config;     
using QuanLyThietBi.Entity;
namespace QuanLyThietBi.ManagerBase
{
                

     public abstract class TBL_BoPhanManagerBase
    {
        public TBL_BoPhanManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity Insert(TBL_BoPhanEntity obj)
        { 
            return (TBL_BoPhanEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity Update(TBL_BoPhanEntity obj)
        { 
            return (TBL_BoPhanEntity)Adapter.Update(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo dieu kien trong object
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity UpdateWithCondition(TBL_BoPhanEntity obj,TBL_BoPhanEntity objCond)
        { 
            return (TBL_BoPhanEntity)Adapter.UpdateWithCondition(obj,objCond);             
        }
 
 
        public TBL_BoPhanEntity Delete(TBL_BoPhanEntity obj)
        { 
            return (TBL_BoPhanEntity)Adapter.Delete(obj);             
        }
 
 
        public TBL_BoPhanEntity DeleteWithCondition(TBL_BoPhanEntity objCond)
        { 
            return (TBL_BoPhanEntity)Adapter.DeleteWithCondition(objCond);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity DeleteByMaBoPhan (TBL_BoPhanEntity obj)
        { 
            return (TBL_BoPhanEntity)Adapter.DeleteByField(obj,"MaBoPhan");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaBoPhan 
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity DeleteByMaBoPhan (string MaBoPhan )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return (TBL_BoPhanEntity)Adapter.DeleteByField(obj,"MaBoPhan");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaQuanLy duoc set trong object
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity DeleteByMaQuanLy (TBL_BoPhanEntity obj)
        { 
            return (TBL_BoPhanEntity)Adapter.DeleteByField(obj,"MaQuanLy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaQuanLy 
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity DeleteByMaQuanLy (string MaQuanLy )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaQuanLy = MaQuanLy;  
            return (TBL_BoPhanEntity)Adapter.DeleteByField(obj,"MaQuanLy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity DeleteByMoTa (TBL_BoPhanEntity obj)
        { 
            return (TBL_BoPhanEntity)Adapter.DeleteByField(obj,"MoTa");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MoTa 
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity DeleteByMoTa (string MoTa )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MoTa = MoTa;  
            return (TBL_BoPhanEntity)Adapter.DeleteByField(obj,"MoTa");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenBoPhan duoc set trong object
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity DeleteByTenBoPhan (TBL_BoPhanEntity obj)
        { 
            return (TBL_BoPhanEntity)Adapter.DeleteByField(obj,"TenBoPhan");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenBoPhan 
        /// </summary>
        /// <returns>TBL_BoPhanEntity</returns>
        public TBL_BoPhanEntity DeleteByTenBoPhan (string TenBoPhan )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.TenBoPhan = TenBoPhan;  
            return (TBL_BoPhanEntity)Adapter.DeleteByField(obj,"TenBoPhan");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public TBL_BoPhanEntity Select(TBL_BoPhanEntity obj)
        { 
            return (TBL_BoPhanEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_BoPhanEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_BoPhanEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new TBL_BoPhanEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new TBL_BoPhanEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_BoPhanEntity> SelectAllLST()
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_BoPhanEntity()),new TBL_BoPhanEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_BoPhanEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_BoPhanEntity(),option),new TBL_BoPhanEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaBoPhan (TBL_BoPhanEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaBoPhan");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaBoPhan (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaBoPhan",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectByMaBoPhanLST (TBL_BoPhanEntity obj)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaBoPhan"),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectByMaBoPhanLST (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaBoPhan",option),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaBoPhan (string MaBoPhan )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return Adapter.SelectByField(obj,"MaBoPhan");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaBoPhan (string MaBoPhan, SelectOptions option)
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return Adapter.SelectByField(obj,"MaBoPhan",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_BoPhanEntity> SelectByMaBoPhanLST (string MaBoPhan )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaBoPhan"),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_BoPhanEntity> SelectByMaBoPhanLST (string MaBoPhan, SelectOptions option)
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaBoPhan",option),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaQuanLy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaQuanLy (TBL_BoPhanEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaQuanLy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaQuanLy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaQuanLy (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaQuanLy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaQuanLy duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectByMaQuanLyLST (TBL_BoPhanEntity obj)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaQuanLy"),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaQuanLy duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectByMaQuanLyLST (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaQuanLy",option),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaQuanLy 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaQuanLy (string MaQuanLy )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaQuanLy = MaQuanLy;  
            return Adapter.SelectByField(obj,"MaQuanLy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaQuanLy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaQuanLy (string MaQuanLy, SelectOptions option)
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaQuanLy = MaQuanLy;  
            return Adapter.SelectByField(obj,"MaQuanLy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaQuanLy 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_BoPhanEntity> SelectByMaQuanLyLST (string MaQuanLy )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaQuanLy = MaQuanLy;  
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaQuanLy"),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaQuanLy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_BoPhanEntity> SelectByMaQuanLyLST (string MaQuanLy, SelectOptions option)
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MaQuanLy = MaQuanLy;  
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaQuanLy",option),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTa (TBL_BoPhanEntity obj)
        { 
            return Adapter.SelectByField(obj,"MoTa");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTa (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MoTa",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectByMoTaLST (TBL_BoPhanEntity obj)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTa"),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectByMoTaLST (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MoTa",option),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTa (string MoTa )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MoTa = MoTa;  
            return Adapter.SelectByField(obj,"MoTa");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTa (string MoTa, SelectOptions option)
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MoTa = MoTa;  
            return Adapter.SelectByField(obj,"MoTa",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_BoPhanEntity> SelectByMoTaLST (string MoTa )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MoTa = MoTa;  
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTa"),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_BoPhanEntity> SelectByMoTaLST (string MoTa, SelectOptions option)
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.MoTa = MoTa;  
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTa",option),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenBoPhan (TBL_BoPhanEntity obj)
        { 
            return Adapter.SelectByField(obj,"TenBoPhan");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenBoPhan (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"TenBoPhan",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenBoPhan duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectByTenBoPhanLST (TBL_BoPhanEntity obj)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenBoPhan"),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenBoPhan duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectByTenBoPhanLST (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"TenBoPhan",option),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenBoPhan 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenBoPhan (string TenBoPhan )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.TenBoPhan = TenBoPhan;  
            return Adapter.SelectByField(obj,"TenBoPhan");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenBoPhan (string TenBoPhan, SelectOptions option)
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.TenBoPhan = TenBoPhan;  
            return Adapter.SelectByField(obj,"TenBoPhan",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenBoPhan 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_BoPhanEntity> SelectByTenBoPhanLST (string TenBoPhan )
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.TenBoPhan = TenBoPhan;  
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenBoPhan"),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_BoPhanEntity> SelectByTenBoPhanLST (string TenBoPhan, SelectOptions option)
        { 
            TBL_BoPhanEntity obj = new TBL_BoPhanEntity();
            obj.TenBoPhan = TenBoPhan;  
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenBoPhan",option),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectWithConditionLST (TBL_BoPhanEntity obj)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new TBL_BoPhanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_BoPhanEntity></returns>
        public List<TBL_BoPhanEntity> SelectWithConditionLST (TBL_BoPhanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_BoPhanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new TBL_BoPhanEntity());
        }

}
}
